import axios from 'axios'

export const getCont = (query) => {
  let url = ''
  let method = ''
  if (query.name === 'story') {
    // eslint-disable-next-line no-const-assign
    url = `api/qf_hotel/findByStoryId?storyId=${query.id}`
    method = 'post'
  } else if (query.name === 'info') {
    // eslint-disable-next-line no-const-assign
    url = `api/qf_hotel/findById_advisoryField?advisoryId=${query.id}`
    method = 'post'
  } else if (query.name === 'shop') {
    // eslint-disable-next-line no-const-assign
    url = `api/qf_hotel/findByShopFieldId?storyId=${query.id}`
    method = 'post'
  }
  return axios({
    method,
    url: url
  })
}

// export const getContImage = (id) => {
//   return axios.get(`api/findById_story?id=${id}`)
// }

export const getContImage = (query) => {
  let url = ''
  let method = ''
  if (query.name === 'story') {
    // eslint-disable-next-line no-const-assign
    url = `api/qf_hotel/findById_story?id=${query.id}`
    method = 'get'
  } else if (query.name === 'info') {
    // eslint-disable-next-line no-const-assign
    url = `api/qf_hotel/findById_advisory?id=${query.id}`
    method = 'get'
  } else if (query.name === 'shop') {
    // eslint-disable-next-line no-const-assign
    url = `api/qf_hotel/findById_shop?id=${query.id}`
    method = 'get'
  }
  return axios({
    method,
    url: url
  })
}
